package cate.common.table.activity.luckybag.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.luckybag.row.LuckyBagRow;

import java.util.List;
import java.util.stream.Collectors;

public class LuckyBagSheet extends ESheet<LuckyBagRow> {
    @Override
    public String getSheetName() {
        return "幸运福袋";
    }

    public List<LuckyBagRow> getRowsByConfigId(int configId) {
        return getList().stream().filter(row->row.configId==configId).collect(Collectors.toList());
    }

    public int getItemId(int configId) {
        return getList().stream().filter(row -> row.configId == configId).mapToInt(row -> row.itemId).findAny().orElse(0);
    }
}
